<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-change-edit" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input name="id" id="id" type="hidden" th:value="${emp.id}"/>
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">工号：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.badge}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">姓名：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.name}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">公司名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.compName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">部门名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.depName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">岗位名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.jobName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">修改信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">入职前后?</label>
                    <div class="col-sm-8">
                        <select name="IsJoin" id="IsJoin" class="form-control m-b">
                            <option value="">请选择</option>
                            <option value="0" th:selected="${emp.IsJoin == 0}">前</option>
                            <option value="1" th:selected="${emp.IsJoin == 1}">后</option>
                        </select></div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">培训类型：</label>
                    <div class="col-sm-8">
                        <select name="TrainType" id="TrainType" class="form-control m-b"
                                th:with="type=${@dict.getType('tCD_TrainType')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:selected="${emp.TrainType+'' == dict.dictValue}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">培训形式:</label>
                    <div class="col-sm-8">
                        <select name="TrainKind" id="TrainKind" class="form-control m-b"
                                th:with="type=${@dict.getType('tCD_TrainKind')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:selected="${emp.TrainKind+'' == dict.dictValue}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">培训主题：</label>
                    <div class="col-sm-8">
                        <input id="Content" name="Content" th:value="${emp.Content}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">培训课程:</label>
                    <div class="col-sm-8">
                        <input id="Course" name="Course" th:value="${emp.Course}" class="form-control"  type="text"/>

                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">开始时间：</label>
                    <div class="col-sm-8">
                        <input id="BeginDate" name="BeginDate" th:value="${emp.BeginDate}" class="form-control laydate-demo-4"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">结束时间:</label>
                    <div class="col-sm-8">
                        <input id="EndDate" name="EndDate" th:value="${emp.EndDate}" class="form-control laydate-demo-3"  type="text"/>

                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">举办机构：</label>
                    <div class="col-sm-8">
                        <input id="Vendor" name="Vendor" th:value="${emp.Vendor}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">培训地点:</label>
                    <div class="col-sm-8">
                        <input id="Place" name="Place" th:value="${emp.Place}" class="form-control"  type="text"/>

                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">课时：</label>
                    <div class="col-sm-8">
                        <input id="Hours" name="Hours" th:value="${emp.Hours}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">所获证书:</label>
                    <div class="col-sm-8">
                        <input id="Certificate" name="Certificate" th:value="${emp.Certificate}" class="form-control"  type="text"/>

                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证书编号：</label>
                    <div class="col-sm-8">
                        <input id="CertificateNo" name="CertificateNo" th:value="${emp.CertificateNo}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">协议编号:</label>
                    <div class="col-sm-8">
                        <input id="AgreementNo" name="AgreementNo" th:value="${emp.AgreementNo}" class="form-control"  type="text"/>

                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">协议开始日期：</label>
                    <div class="col-sm-8">
                        <input id="Abegindate" name="Abegindate" th:value="${emp.Abegindate}" class="form-control laydate-demo-2"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">协议期:</label>
                    <div class="col-sm-8">
                        <input id="Aterm" name="Aterm" th:value="${emp.Aterm}" class="form-control"  type="text"/>

                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">协议结束日期：</label>
                    <div class="col-sm-8">
                        <input id="Aenddate" name="Aenddate" th:value="${emp.Aenddate}" class="form-control laydate-demo-1"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">培训费用:</label>
                    <div class="col-sm-8">
                        <input id="Expenses" name="Expenses" th:value="${emp.Expenses}" class="form-control"  type="text"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "bgInfo/title";

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-3',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-4',
                type: 'date'
            });
        });
    });


    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-change-edit").serializeArray();
            var id = $("#id").val();
            var IsJoin = $("#IsJoin").val();
            var TrainType = $("#TrainType").val();
            var TrainKind = $("#TrainKind").val();
            var Content = $("#Content").val();
            var Course = $("#Course").val();
            var BeginDate = $("#BeginDate").val();
            var EndDate = $("#EndDate").val();
            var Vendor = $("#Vendor").val();
            var Place = $("#Place").val();
            var Hours = $("#Hours").val();
            var Certificate = $("#Certificate").val();
            var CertificateNo = $("#CertificateNo").val();
            var AgreementNo = $("#AgreementNo").val();
            var Abegindate = $("#Abegindate").val();
            var Aterm = $("#Aterm").val();
            var Aenddate = $("#Aenddate").val();
            var Expenses = $("#Expenses").val();
            data.push({"name": "id", "value": id});
            data.push({"name": "IsJoin", "value": IsJoin});
            data.push({"name": "TrainType", "value": TrainType});
            data.push({"name": "TrainKind", "value": TrainKind});
            data.push({"name": "Content", "value": Content});
            data.push({"name": "Course", "value": Course});
            data.push({"name": "BeginDate", "value": BeginDate});
            data.push({"name": "EndDate", "value": EndDate});
            data.push({"name": "Vendor", "value": Vendor});
            data.push({"name": "Place", "value": Place});
            data.push({"name": "Hours", "value": Hours});
            data.push({"name": "Certificate", "value": Certificate});
            data.push({"name": "CertificateNo", "value": CertificateNo});
            data.push({"name": "AgreementNo", "value": AgreementNo});


            $.operate.save(prefix + "/edit", data);
        }
    }

</script>
</body>
</html>
